<template>
    <div>
        useVModel
        <!-- <input type="text" > -->
        <p>name:{{ name }}</p>
        <p>name:{{ age }}</p>
        <button @click="onChange">change</button>
    </div>
</template>

<script setup>
import {useVModel} from '@vueuse/core'
import {ref, onMounted, } from 'vue'
const props = defineProps({
    name: 'string',
    age: 'number'
})
const emits = defineEmits(['update:name', 'update:age'])
const name = useVModel(props, 'name', emits)
const age = useVModel(props, 'age', emits)


const onChange = () => {
    name.value = 'jjjkkk'
    age.value = 20
}
</script>